# This is a Python3 Script used to generate model files of misaka cakes with candles
import json

colors = ["black","blue","brown","cyan","gray","green","light_blue","light_gray","lime","magenta","orange","pink","purple","red","white","yellow"]

# Model Template
mdlt = {
  "parent": "misaka:block/food/template_cake_with_candle",
  "textures": {
    "candle": "minecraft:block/black_candle",
    "bottom": "misaka:block/cake_bottom",
    "side": "misaka:block/cake_side",
    "top": "misaka:block/cake_top",
    "particle": "misaka:block/cake_side"
  }
}

# Unstained Candle
with open('candle_cake.json', 'w+') as f:
    mdlt["textures"]["candle"] = "minecraft:block/candle"
    data = json.dumps(mdlt, sort_keys=True, indent=4, separators=(',', ': '))
    f.write(data)

with open('candle_cake_lit.json', 'w+') as f:
    mdlt["textures"]["candle"] = "minecraft:block/candle_lit"
    data = json.dumps(mdlt, sort_keys=True, indent=4, separators=(',', ': '))
    f.write(data)

# Colored Candles...
for col in range(0, len(colors)):
    with open(colors[col] + '_candle_cake.json', 'w+') as f:
        mdlt["textures"]["candle"] = "minecraft:block/" + colors[col] + "_candle"
        data = json.dumps(mdlt, sort_keys=True, indent=4, separators=(',', ': '))
        f.write(data)
    
    with open(colors[col] + '_candle_cake_lit.json', 'w+') as f:
        mdlt["textures"]["candle"] = "minecraft:block/" + colors[col] + "_candle_lit"
        data = json.dumps(mdlt, sort_keys=True, indent=4, separators=(',', ': '))
        f.write(data)
